home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 200
/
200.d81
/
as maze maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
104 lines
100 ifml=1then850
110 ifml=2thenml=.:goto230
120 poke52,48:poke56,48:clr:dv=peek(186):ifdv<8thendv=8
130 poke56334,peek(56334)or1:poke53272,(peek(53272)and240)+12
140 ifpeek(12288)=60then160
150 sys57812"pieces",dv,1:poke780,0:poke781,0:poke782,48:sys65493:goto100
160 dima$(25)
170 deffnp(qr)=1024+xp+yp*40:deffnc(qr)=55296+xp+yp*40:deffnj(qr)=peek(56320)
180 rem
190 print"[152][147][144]";
200 poke53281,12:fort=1to23:print"[152] ";
210 dn$=""
220 next
230 print"";left$(dn$,23);
240 print"[144] a [159]b c d [149]e [151]f g h i j k l m [144]o s[157]^[145] z [153][163] [210][145]";
250 ov$=""
260 ford=.to15:print"";left$(ov$,36)left$(dn$,d+6);:poke646,d:print"[209][209]":next
270 print""tab(37)"[144]all"
280 print""tab(36)"[144]save"
290 print""tab(36)"[144]load":print""tab(36)"quit"
300 xp=.:yp=.:qr=.:pc=peek(fnp(qr)):ch=5:sh=9:ps=peek(fnc(qr)):sp=40:bs=.:bc=32
310 bc=32:ifch=32thenbc=160
320 geta$:iffnj(qr)<>127ora$<>""thenj=fnj(qr):goto350
330 pokefnp(qr),ch:pokefnc(qr),sh:fort=1to20:next
340 pokefnp(qr),bc:pokefnc(qr),bs:goto320
350 ifj=126andyp>.thengosub880:yp=yp-1:goto900
360 ifj=125andyp<22thengosub880:yp=yp+1:goto900
370 ifj=123andxp>.thengosub880:xp=xp-1:goto900
380 ifj=119andxp<35thengosub880:xp=xp+1:goto900
382 ifj=122andxp>.andyp>0thengosub880:yp=yp-1:xp=xp-1:goto900
384 ifj=118andyp>0andxp<35thengosub880:yp=yp-1:xp=xp+1:goto900
386 ifj=121andxp>.andyp<22thengosub880:xp=xp-1:yp=yp+1:goto900
388 ifj=117andxp<35andyp<22thengosub880:xp=xp+1:yp=yp+1:goto900
390 ifa$=chr$(160)andxp>1thengosub880:xp=xp-2:goto900
400 ifa$=""thengosub880:xp=35:goto900
410 ifa$=" "andxp<33thengosub880:xp=xp+2:goto900
420 ifa$="[157]"thengosub880:xp=.:goto900
430 ifa$="[147]"then190
440 ifa$="[145]"thengosub880:yp=.:goto900
450 ifa$="m"thengosub880:xp=17:yp=11:goto900
460 ifa$=""thengosub880:yp=22:goto900
470 ifa$="e"thenpokefnp(qr),peek(2023):pokefnc(qr),peek(53281):gosub870:goto900
480 ifj=111andyp<22andxp<35thengosub890:goto900
490 ifj=110andyp>.andxp<35thengosub890:yp=yp-1:goto900
500 ifj=109andyp<22andxp<35thengosub890:yp=yp+1:goto900
510 ifj=107andxp>.andxp<35andyp<22thengosub890:xp=xp-1:goto900
520 ifj=103andxp<35andyp<22thengosub890:xp=xp+1:goto900
530 ifj<>111then310
540 ifyp=22andpeek(1024+xp+(yp+1)*40)<>chthench=peek(1024+xp+(yp+1)*40):goto310
550 ifyp=22andpeek(1024+xp+(yp+1)*40)=chthensh=peek(55296+xp+(yp+1)*40):goto310
560 ifxp=35andyp>5thensh=peek(55296+(xp+1)+yp*40):goto310
570 ifyp=.then610
580 ifyp=1then630:rem * load
590 ifyp=2then820:rem * save
593 ifyp=4thengosub1000:goto230:rem * quit
600 goto330
610 fort=1024to1983:ifpeek(t)=chthenpoke54272+t,sh
620 next:goto330
630 print"";left$(dn$,23);" "
640 print"";left$(dn$,23);
650 print"enter the # for this maze-- ";:b$="":gosub940:mn$=str$(n)
660 print"";left$(dn$,23)"[144] "
670 ford=.to22:print"";left$(ov$,35)left$(dn$,d);:print" ":next
680 close15:open15,dv,15,"i0:"
685 print#15,"s0:maze "+mn$+".ml":print#15,"i0":print#15,"s0:maze "+mn$+"/c.ml"
690 print#15,"i0:":close15
700 o=1024:print"";left$(dn$,23)"please wait... "
710 fory=.to22:a$(y)="":forx=.to38:a=peek(1024+x+y*40)
720 ifa=15thenxx=x:yy=y
730 a$(y)=a$(y)+chr$(a)
740 next:next
750 open2,dv,2,"0:maze "+mn$+".ml,p,w":print#2,chr$(0)+chr$(4);
760 fort=.to22:print#2,a$(t)+" ";:next:print#2,chr$(xx):print#2,chr$(yy):close2
770 fory=.to22:a$(y)="":forx=.to38:a=peek(55296+x+y*40)
780 a$(y)=a$(y)+chr$(a)
790 next:next
800 open2,dv,2,"0:maze "+mn$+"/c.ml,p,w":print#2,chr$(0)+chr$(216);
810 fort=.to22:print#2,a$(t)+" ";:next:close2:goto230
820 input"[147]maze number";mn$
830 ml=1
840 load"maze "+mn$+".ml",dv,1
850 ml=2:load"maze "+mn$+"/c.ml",dv,1
860 stop
870 pc=peek(2023):ps=peek(53281):return
880 pokefnp(qr),pc:pokefnc(qr),ps:return
890 pc=ch:ps=sh:pokefnp(qr),ch:pokefnc(qr),sh:return
900 ps=peek(fnc(qr)):pc=peek(fnp(qr)):ifch=32thenbc=160:goto920
910 bc=32
920 pokefnp(qr),ch:pokefnc(qr),sh
930 pokefnp(qr),bc:pokefnc(qr),bs:goto320
940 geta$:ifa$=""then940
950 ifa$=chr$(13)thenn=val(b$):return
960 ifa$=chr$(20)andb$<>""thenprint"[157] [157]";:b$=left$(b$,len(b$)-1):goto940
970 ifval(a$)=.anda$<>"0"then940
980 b$=b$+a$:print"[144]"a$;:goto940
1000 print"";left$(dn$,23);" "
1005 print"";left$(dn$,23);
1010 print"are you sure you want to quit? (y/n)"
1015 gett$:ift$<>"y"andt$<>"n" then1015
1020 ift$="n"thenreturn
1030 poke52,160:poke56,160:poke53272,(peek(53272)and240)or4:print"[147]":load"as menu",dv
9999 end
10000 d=peek(186):n$="as maze maker":open15,d,15,"s0:"+n$:close15:saven$,d:end